#ifndef __SVC__
#define __SVC__

#include "stdint.h"
#include "stdbool.h"
#include "svc_ipc.h"
#include "svc_mem.h"

#define PT_KERNEL_SVC_BASE           0x01   
enum PT_KERNEL_SVCS
{
	PT_MB_INIT_SVC 					= PT_KERNEL_SVC_BASE,
	PT_MB_CREATE_SVC,
	PT_MB_DELETE_SVC,
	PT_MB_SEND_SVC,
	PT_MB_RECV_SVC,
	
	PT_MQ_CREATE_SVC,
	PT_MQ_DELETE_SVC,
	PT_MQ_INIT_SVC,
	PT_MQ_SEND_SVC,
	PT_MQ_RECV_SVC,
	
	PT_TIMER_EXPIRED_SVC,
	PT_TIMER_SET_SVC,
	PT_TIMER_CREATE_SVC,
	
	PT_MALLOC_SVC,
	PT_FREE_SVC,
	
};


#define MODE_HANDLER	0

#ifdef __cplusplus
extern "C" {
#endif

#ifdef SVCALL_AS_NORMAL_FUNCTION
	#define SVCALL(number, return_type, signature) return_type signature
#else

	#ifndef SVCALL
		#if defined (__CC_ARM)
			#define SVCALL(number, return_type, signature) return_type __svc(number) signature
		#else
			#define SVCALL(number, return_type, signature) return_type signature
		#endif
	#endif  // SVCALL

#endif  // SVCALL_AS_NORMAL_FUNCTION

bool is_in_svc(void);

	
#ifdef __cplusplus
}
#endif
#endif  // __SVC__
